package com.sunrate.investingquote.controller;

import com.sunrate.investingquote.dto.CreateWssDTO;
import com.sunrate.investingquote.service.QuoteWebSocketClientService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author yyh
 * @description:
 * @date 2023/06/15/ 16:07
 */
@RestController
@RequestMapping("/investing-quote")
@Slf4j
public class InvestingQuoteController {

    @Autowired
    private QuoteWebSocketClientService quoteWebSocketClientService;

    @PostMapping("/startClient")
    public void startClient(@RequestBody CreateWssDTO wssDTO) {
        quoteWebSocketClientService.startClient(wssDTO.getUri());
    }
}
